package cn.zysheep.singleton.demo2;

import java.io.Serializable;

/**
 * @ClassName: Singleton
 * @Description: 静态创建
 * @Author: lyw
 * @Date: 2022/10/17 21:39
 */
public class Singleton implements Serializable {
    private Singleton(){}

    private static Singleton singleton;

    static {
        singleton = new Singleton();
    }
    public static Singleton getInstance() {
        return singleton;
    }
}
